package com.example.testcomposeproject.pages.testModifier

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import com.example.testcomposeproject.PreViewData
import com.example.testcomposeproject.pages.copy.CopyViewModel
import com.example.testcomposeproject.ui.theme.AppTheme

/**
 * @author: hemin
 * @date: 2024/6/21
 * @Desc:
 */
@Preview(showBackground = true, device = PreViewData.PreviewPhoneSize)
@Composable
fun PreViewTestModifierUI(modifier: Modifier = Modifier) {
    AppTheme {
        TestModifierUI(modifier = modifier.background(Color.Yellow))

    }
}

/**
 * viewModel 用这个方法
 */
@Composable
fun TestModifierScreen(modifier: Modifier = Modifier,viewModel: CopyViewModel = hiltViewModel()) {
    TestModifierUI(modifier)
}

/**
 * 真正的UI元素
 */
@Composable
fun TestModifierUI(modifier: Modifier = Modifier) {
    Text(text ="TestModifierUI",modifier=Modifier)
}